package com.lh.entity.table;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import javax.persistence.Table;
import java.util.Date;

@Table(name = "approval_record")
@Data
public class ApprovalRecord {

    /**
     * 审批记录唯一标识（主键）
     */
    @TableId(type = IdType.AUTO, value = "approval_id")
    private Integer approvalId;

    /**
     * 任务id
     */
    @TableField(value = "rectification_id")
    private Integer rectificationId;

    /**
     * 事项名称
     */
    @TableField(value = "title")
    private String title;

    /**
     * 申请人姓名
     */
    @TableField(value = "apply_user")
    private String applyUser;

    /**
     * 申请人所属部门
     */
    @TableField(value = "apply_dept")
    private String applyDept;

    /**
     * 审批人
     */
    @TableField(value = "approval_user")
    private String approvalUser;

    /**
     * 审批人所在部门
     */
    @TableField(value = "approval_dept")
    private String approvalDept;

    @TableField(value = "apply_time", exist = true)
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date applyTime;

    @TableField(value = "approval_time", exist = true)
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date approvalTime;

    @TableField(value = "approval_status")
    private Integer approvalStatus;

    /**
     * 处理结果
     */
    @TableField(value = "handle_result")
    private String handleResult;

    /**
     * 备注信息
     */
    @TableField(value = "remark")
    private String remark;
}
